import { createRouter, createWebHashHistory } from "vue-router";
// import HelloWorld from '../components/HelloWorld.vue';
// import BigScreen from '../components/screen/BigScreen.vue';
import HomePage from '../components/homepage.vue';
const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      title: '登录',
      requiresAuth: false, // false表示不需要登录
      },
    component: () => import('../components/login/login.vue'),
  },
  {
    path: '/homepage',
    name: 'homepage',
    redirect: '/home',
    component: HomePage,
    meta: {
      title: '首页',
      requiresAuth: true, // true表示需要登录
    },
    children:[
          {
            path: '/home',
            name: '首页',
            // component: () => import('../components/firstpage/firstpage.vue'),
            component: () => import('../components/firstpage/home.vue'),
            meta: {
              title: '首页',
              requiresAuth: true,
            },
          }
      ]
    
  },
  {
    path: '/tugManage',
    name: 'tugManage',
    redirect: '/home',
    component: HomePage,
    meta: {
      title: '拖轮管理',
      requiresAuth: true, // true表示需要登录
    },
    children:[
		//基础数据
		{
		  path:'/basicData',
		  name: '基础数据',
		  meta: {
		    title: '基础数据',
		  },
		  children:[
		    {
		      path: '/tug',
		      name: '拖轮信息',
		      component: () => import('@/views/basicData/tug/index'),
		      meta: {
		        title: '拖轮信息',
		      },
		    },
			  {
			    path: '/rate',
			    name: '拖轮费率',
			    component: () => import('@/views/basicData/rate/index'),
			    meta: {
			      title: '拖轮费率',
			    },
			  },
			  {
			    path: '/ship',
			    name: '大船规范',
			    component: () => import('@/views/basicData/ship/index'),
			    meta: {
			      title: '大船规范',
			    },
			  },
			  {
			    path: '/workItem',
			    name: '作业项目',
			    component: () => import('@/views/basicData/workItem/index'),
			    meta: {
			      title: '作业项目',
			    },
			  },
			  {
			    path: '/customer',
			    name: '客户信息',
			    component: () => import('@/views/basicData/customer/index'),
			    meta: {
			      title: '客户信息',
			    },
			  },
			  {
			    path: '/crewCertificate',
			    name: '证书管理',
			    component: () => import('@/views/basicData/crewCertificate/index'),
			    meta: {
			      title: '证书管理',
			    },
			  },
			  {
			    path: '/dockBerth',
			    name: '泊位维护',
			    component: () => import('@/views/basicData/dockBerth/index'),
			    meta: {
			      title: '泊位维护',
			    },
			  },
			  {
			    path: '/dict',
			    name: '字典管理',
			    component: () => import('@/views/basicData/dict/index'),
			    meta: {
			      title: '字典管理',
			    },
			  },
		  ]
		},
		//基础数据
		{
		  path:'/plan',
		  name: '计划调度',
		  meta: {
		    title: '计划调度',
		  },
		  children:[
		    {
		      path: '/plan',
		      name: '作业计划',
		      component: () => import('@/views/plan/plan/index'),
		      meta: {
		        title: '作业计划',
		      },
		    },
			  {
			    path: '/disLog',
			    name: '调度日志',
			    component: () => import('@/views/plan/disLog/index'),
			    meta: {
			      title: '调度日志',
			    },
			  },
			  {
			    path: '/pordWork',
			    name: '作业记录',
			    component: () => import('@/views/plan/pordWork/index'),
			    meta: {
			      title: '作业记录',
			    },
			  },
			  {
			    path: '/specialWork',
			    name: '特殊作业记录',
			    component: () => import('@/views/plan/specialWork/index'),
			    meta: {
			      title: '特殊作业记录',
			    },
			  },
		  ]
		},
		//商务计费
		{
		  path:'/business',
		  name: '商务计费',
		  meta: {
		    title: '商务计费',
		  },
		  children:[
		    {
		      path: '/tugCharging',
		      name: '拖轮计费',
		      component: () => import('@/views/business/tugCharging/index'),
		      meta: {
		        title: '拖轮计费',
		      },
		    },
		    {
		      path: '/business-specialWork',
		      name: '特殊作业计费',
		      component: () => import('@/views/business/specialWork/index'),
		      meta: {
		        title: '特殊作业计费',
		      },
		    },
		  ]
		},
		//能耗管理
		{
		  path:'/consume',
		  name: '能耗管理',
		  meta: {
		    title: '能耗管理',
		  },
		  children:[
		    {
		      path: '/consume',
		      name: '能耗管理',
		      component: () => import('@/views/consume/index'),
		      meta: {
		        title: '能耗管理',
		      },
		    },
		  ]
		},
    ]
    
  },
  {
    path: '/screen',
    name: 'screen',
    meta: {
    //   title: '大屏',
      requiresAuth: false, // false表示不需要登录
      },
    component: () => import('@/components/screen/index.vue'),
  },
      // 培训考试
  {
    path:'/learn',
    menuName: 'learn',
    redirect: '/trainingmanagement',
    component: HomePage,
    meta: {
      title: '培训考试',
    },
    children:[
      {
        path: '/health',
        name: '职业健康',
        component: () => import('../components/system/usercertificate/usercertificate.vue'),
        meta: {
          title: '职业健康',
        },
      },
  
    ]
  },
 
  // 系统管理
  {
    path: '/system',
    name: '系统管理',
    redirect: '/datadictionary',
    component: HomePage,
    meta: {
      title: '系统管理',
    },
    children: [
      {
        path: '/datapermissions',
        name: '数据权限',
        component: () => import('../components/system/datapermissions/datapermissions.vue'),
        meta: {
          title: '数据权限',
        },
      },
      {
        path: '/datadictionary',
        name: '数据字典',
        component: () => import('../components/system/datadictionary/datadictionary.vue'),
        meta: {
          title: '数据字典',
        },
      },
      {
        path: '/role',
        name: '功能权限',
        component: () => import('../components/system/role/role.vue'),
        meta: {
          title: '功能权限',
        },
      },
      {
        path: '/user',
        name: '组织架构',
        component: () => import('../components/system/user/user.vue'),
        meta: {
          title: '组织架构',
        },
      },
      {
        path: '/log',
        name: '操作日志',
        component: () => import('../components/system/log/log.vue'),
        meta: {
          title: '操作日志',
        },
      },
      {
        path: '/approval',
        name: '审批流程',
        component: () => import('../components/system/approval/approval.vue'),
        meta: {
          title: '审批流程',
        },
      },
      {
        path: '/notice',
        name: '公告',
        component: () => import('../components/system/notice/notice.vue'),
        meta: {
          title: '公告',
        },
      },
      {
        path: '/department',
        name: '成员与部门',
        component: () => import('../components/system/department/department.vue'),
        meta: {
          title: '成员与部门',
        },
      },
      {
        path: '/violationrecords',
        name: '安全违规记录',
        component: () => import('../components/system/violationrecords/violationrecords.vue'),
        meta: {
          title: '安全违规记录',
        },
      },
      {
        path: '/statisticalconfiguration',
        name: '统计配置',
        redirect: '/onepage',
        meta: {
          title: '统计配置',
        },
        children: [
            {
                path: '/onepage',
                name: '一张图配置',
                component: () => import('../components/system/statisticalconfiguration/onepage/onepage.vue'),
                meta: {
                  title: '一张图配置',
                },
            },
            {
                path: '/throughput',
                name: '年度计划吞吐量',
                component: () => import('../components/system/statisticalconfiguration/throughput/throughput.vue'),
                meta: {
                  title: '年度计划吞吐量',
                },
            },
            {
                path: '/lossrate',
                name: '货物亏损率',
                component: () => import('../components/system/statisticalconfiguration/lossrate/lossrate.vue'),
                meta: {
                  title: '货物亏损率',
                },
            },
            {
                path: '/customersatisfaction',
                name: '客户满意度',
                component: () => import('../components/system/statisticalconfiguration/customersatisfaction/customersatisfaction.vue'),
                meta: {
                  title: '客户满意度',
                },
            },
            {
                path: '/recorddisplay',
                name: '创纪录展示',
                component: () => import('../components/system/statisticalconfiguration/recorddisplay/recorddisplay.vue'),
                meta: {
                  title: '创纪录展示',
                },
            },
        ]
      },
      
  ]
  },
];
const router = createRouter({
  mode:'history',
  history: createWebHashHistory(),
  routes
  // routes:[
  //   routes,
  //   tugRouter.routes
  // ]
});
export default router;